package com.exposit.smarthouse.obj.impl;

import com.exposit.smarthouse.obj.Environment;

import javax.persistence.*;

@Entity
@Table(name = EnvironmentEntity.TABLE_NAME)
public class EnvironmentEntity extends PersistenceEntity implements Environment
{
    public static final String TABLE_NAME = "ENVIRONMENT_TABLE";
    public static final String COLUMN_TEMP = "TEMP";
    public static final String COLUMN_HUMIDITY = "HUMIDITY";

    private double temp;
    private double humidity;

    public EnvironmentEntity()
    {
    }

    public EnvironmentEntity(double temp, double humidity)
    {
        this.temp = temp;
        this.humidity = humidity;
    }

    @Column(name = COLUMN_TEMP, nullable = false, length = 10)
    public double getTemp()
    {
        return temp;
    }

    public void setTemp(double temp)
    {
        this.temp = temp;
    }

    @Column(name = COLUMN_HUMIDITY, nullable = false, length = 10)
    public double getHumidity()
    {
        return humidity;
    }

    public void setHumidity(double humidity)
    {
        this.humidity = humidity;
    }
}
